package ysq.xyg.web.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 网站模块-网站栏目实体类
 *
 * @author shengQiang yu
 * @date 2019-6-5 22:15:56
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_column_type")
public class WebColumnType implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 栏目名称
     */ 
	@Column(name = "name")
	private String name;
	
	/**
     * 栏目类型:1、普通文章，2、图片集，3、banner图
     */ 
	@Column(name = "col_type")
	private String colType;
	
	/**
     * 缩略图
     */ 
	@Column(name = "thum_image")
	private String thumImage;
	
	/**
     * 封面图
     */ 
	@Column(name = "cover_image")
	private String coverImage;
	
	/**
     * seo关键字
     */ 
	@Column(name = "seo_keyword")
	private String seoKeyword;
	
	/**
     * 栏目描述
     */ 
	@Column(name = "description")
	private String description;
	
	/**
     * 排序号，数据越大越往前
     */ 
	@Column(name = "sort")
	private String sort;
	
	/**
     * 是否展示:1、是，2、否
     */ 
	@Column(name = "show_type")
	private String showType;
	
	/**
     * 用户id
     */ 
	@Column(name = "user_id")
	private String userId;
	
	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	/**
	 * 文章集合
	 */
	@Transient
	private List<WebArticle> webArticleList;
	/**
	 * 标签id集合，多个用","隔开
	 */
	@Transient
	private String tagIds;
	/**
	 * 标签名称集合，多个用","隔开
	 */
	@Transient
	private String tagNames;

	public WebColumnType(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}


}